import { defineStore } from "pinia";
import { store } from "@/store";
import { chatStoreFace, ConversationGroupListFace, ModelTypeCace } from "@/types/chat.type";
const appStore = defineStore({
    id: "chat",
    state: (): chatStoreFace => ({
        currentConversationGroupId: 0,
        currentModelId: 0,
        currentModel: "",
        models: [],
        list: [],
        ConversationGroupList: []
    }),
    actions: {
        setCurrentConversationGroupId(id: number) {
            this.currentConversationGroupId = id
        },
        setCurrentModelId(id: number) {
            this.currentModelId = id
        },
        setCurrentModel(model: string) {
            this.currentModel = model
        },
        setModels(model: Array<string>) {
            this.models = model
        },
        setModelList(data: Array<ModelTypeCace>) {
            this.list = data
        },
        setConversationGroup(data: ConversationGroupListFace[]) {
            this.ConversationGroupList = data
        }
    },
    getters: {
        getCurrentConversationGroupId() {
            return this.currentConversationGroupId
        },
        getCurrentModelId(): number {
            return this.currentModelId
        },
        getCurrentModel(): string {
            return this.currentModel
        },
        getModels(): Array<string> {
            return this.models
        },
        getModelsList(): Array<ModelTypeCace> {
            return this.list
        },
        getConversationGroup():Array<ConversationGroupListFace>{
            return this.ConversationGroupList
        }
    }
})
export function useChatStoreWithOut() {
    return appStore(store);
}